﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Abp.Application.Services.Dto;
using Abp.AspNetCore.Mvc.Authorization;
using Abp.Runtime.Validation;
using AutoMapper;
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
using Xwy.MyProject.Authorization;
using Xwy.MyProject.Controllers;
using Xwy.MyProject.Modules;
using Xwy.MyProject.Modules.Dto;

namespace Xwy.MyProject.Web.Controllers
{
    //[AbpMvcAuthorize(PermissionNames.Pages_Modules)]
    [AbpMvcAuthorize]
    public class ModulesController : MyProjectControllerBase
    {
        private readonly IModuleAppService _moduleAppService;

        public ModulesController(IModuleAppService moduleAppService)
        {
            _moduleAppService = moduleAppService;
        }

        public ActionResult Index() 
        {
           
            return View();
        }

        public async Task<ActionResult> EditModal(int moduleId)
        {
            var moduleDto = await _moduleAppService.GetAsync(new EntityDto(moduleId));
            return PartialView("_EditModal", moduleDto);
        }
    }
}
